# -*- coding:utf-8 -*-

# 1.导入flask扩展
import json
from flask import Flask 
from flask import render_template,request

# 2.创建flask应用程序实例
app = Flask(__name__)

# 3. 定义路由和视图函数
@app.route('/',methods=["GET","POST"])
def index():
    return render_template("index.html")

@app.route("/download",methods=["GET","POST"])
def send():
    print("send")
    jsonstr = request.get_json()
    print(jsonstr["num"])
    return jsonstr["num"]


# 4. 启动服务
if __name__ == '__main__':
    app.run()
